import {request} from "./request";

export function getdetail(iid){
  return request({
    url:'/detail',
    params:{
      iid
    }
  })
}


export function getrecommend() {
  return request({
    url:'/recommend',

  })
}

export class Goodsinfo{
  constructor(itemInfo , columns, services) {
    this.title = itemInfo.title
    this.cartprice = itemInfo.lowNowPrice
    this.desc = itemInfo.desc
    this.newPrice = itemInfo.price
    this.oldPrice = itemInfo.oldPrice
    this.discount = itemInfo.discountDesc
    this.columns = columns
    this.serveices = services
    this.realPrice =itemInfo.lowNowPrice
  }
}

export class Shopinfo{
  constructor(shopinfo) {
    this.logo = shopinfo.shopLogo
    this.name = shopinfo.name
    this.fans = shopinfo.cFans
    this.sells = shopinfo.cSells
    this.score = shopinfo.score
    this.goodsCount = shopinfo.cGoods
  }
}

export class GoodsParam{
  constructor(info,rule) {
    this.image = info.images ? info.images[0] : '';
    this.infos = info.set;
    this.sizes = rule.tables;
  }
}
